home *** CD-ROM | disk | FTP | other *** search
- double timeArray[];
-
- ** This block adds the inputs and outputs their sum.
- ** Copyright © 1989-1994 by Imagine That, Inc.
- ** All Rights Reserved.
- ** Extend Generic Library, Add block; Alfy Riddle
- ** modified 1/1/92 JSL modified for V2.0
- ** 2/14/94 DJK modified trace and report
- ** 3/10/94 DJK added block label to trace & report
-
-
-
- procedure calc()
- {
- conOut = con1In + con2In + con3In;
-
- ** sysglobal2 is the file reference number for the DEBUG TRACE
- if( sysGlobal2 != 0.0 ) ** 0 is error, check for open file for TRACE
- {
- // template for report: |BLOCK NAME *****************|block number |BLOCK NUMBER*******
- fileWrite(sysGlobal2,"Add block number "+(MyBlockNumber())+". Current Time:"+currentTime+".","",True);
- if(getBlockLabel(myBlockNumber()) != "")
- fileWrite(sysGlobal2,"Block Label: "+getBlockLabel(myBlockNumber()),"",True);
- fileWrite(sysGlobal2," Top Input = "+con1In,"",True);
- fileWrite(sysGlobal2," Mid Input = "+con2In,"",True);
- fileWrite(sysGlobal2," Bot Input = "+con3In,"",True);
- fileWrite(sysGlobal2," Output = "+conOut,"",True);
- fileWrite(sysGlobal2," ","",True);
- }
- }
-
-
- ** This message occurs for each step in the simulation.
- on Simulate
- {
- calc();
- }
-
-
- ** If the dialog data is inconsistent for simulation, abort.
- ** check connections during checkData
- on checkData
- {
- sysGlobal1 = 0.0; ** prevent false reports
- sysGlobal2 = 0.0; ** prevent false debugs
- }
-
-
- ** Initialize any simulation variables.
- on initSim
- {
- if( getPassedArray(sysGlobal0, timeArray) )
- getSimulateMsgs(FALSE);
- }
-
-
- on endSim
- {
- ** sysGlobal1 is the file reference number for the TEXT REPORT
- if( sysGlobal1 != 0.0 ) ** 0 is error, check for open file for REPORT
- {
- // template for report: |BLOCK NAME *****************|block number |BLOCK NUMBER*******
- fileWrite(sysGlobal1,"Add block number "+MyBlockNumber(),"",True);
- if(getBlockLabel(myBlockNumber()) != "")
- fileWrite(sysGlobal1,"Block Label: "+getBlockLabel(myBlockNumber()),"",True);
- if( comments != "" )
- fileWrite(sysGlobal1,"Comments = "+comments,"",True);
- fileWrite(sysGlobal1," ","",True);
- }
- }